package com.dnui.seven2.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dnui.seven2.entity.Buyshow;
import com.dnui.seven2.entity.Collection;
import com.dnui.seven2.service.CollectionService;
import com.dnui.seven2.mapper.CollectionMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


import java.util.List;

/**
* @author Asus
* @description 针对表【collection】的数据库操作Service实现
* @createDate 2022-10-27 00:18:20
*/
@Service
public class CollectionServiceImpl extends ServiceImpl<CollectionMapper, Collection>
    implements CollectionService{
    @Autowired
    CollectionMapper collectionMapper;



    @Override
    public Collection queryById(Long collectionId) {
        return collectionMapper.selectById(collectionId);
    }


    @Override
    public void deleteCollection(Long collectionId) {
        collectionMapper.deleteById(collectionId);
    }

    @Override
    public void updateCollection(Collection collection) {
        collectionMapper.updateById(collection);
    }

    @Override
    public List<Collection> selectAll() {
        //构造条件构造器
        LambdaQueryWrapper<Collection> queryWrapper=new LambdaQueryWrapper();
        List<Collection> collections = collectionMapper.selectList(null);
        return collections;
    }
}




